<?php
//模块插件类
//对外接口函数类，其他插件可通过“$this->plugin('模块名称')->方法名” 来调用本类的方法
defined('BY_JYA') or exit('error');
class func_jy_dxton extends plugin{
	public function dxton($getdata,$pluginname){
		$setting=$this->get_setting();
		$data='account='.$setting['accoumt'].'&password='.$setting['password'].'&mobile='.$getdata['mobile'].'&content='.$getdata['content'];
		$target = "http://sms.106jiekou.com/utf8/sms.aspx";
		$return=$this->Post($data,$target);
		if($return==100){
			$status=1;
		}else{
			$status=0;
		}
		switch ($return)
		{
			case 100:
				$return="发送成功";
				break;
			case 102:
				$return="发送失败";
				break;
			case 103:
				$return="会员级别不够";
				break;
			case 104:
				$return="内容未审核";
				break;
			case 105:
				$return="内容过多";
				break;
			case 106:
				$return="账户余额不足";
				break;
			case 107:
				$return="Ip受限";
				break;
			case 108:
				$return="手机号码发送太频繁，请换号或隔天再发";
				break;
			case 109:
				$return="账号被锁定";
				break;
			case 110:
				$return="手机号发送频率持续过高，黑名单屏蔽数日";
				break;
			case 120:
				$return="系统升级";
				break;
				
			default:
				$return="发送失败";
				break;
		}
		
		$logdata=array(
		'uniacid'=>$_SESSION['uniacid'],
		'plugin'=>$pluginname,
		'sms'=>$getdata['content'],
		'remark'=>$return,
		'status'=>$status,
		'createtime'=>TIMESTAMP
		);	
		$this->insert('log',$logdata);
		return $return;
		
	}
	private function Post($data, $target) {
    $res=cfc('http')->ihttp_request($target,$data);
	return $res['content'];


}

}
?>